
$(function(){
	document.documentElement.style.fontSize = window.innerWidth/3.75 + 'px';
  //东风首页数据
  var data1 = {
    url1: "/dingding-web/renteqsale/img/dongfeng_banner.jpg",
    p1: "凡是注册成为叮叮约车的用户，缴纳一定量的租金和保障金，" +
        "即可通过叮叮约车，领取由其合作汽车厂商东风风神所提供的新车一辆。",
    p2: "车型选择方面，目前叮叮约车为用户提供东风风神suv车型AX7的2.0L自动智逸型和1.4T手动智悦型。",
    p3: "根据车型不同，用户在缴纳一定量的保障金后，即可提前获得车辆使用权。相较这两款车型" +
        "的市场销售价格，用户通过此种方式用车，可比直接买车节省数万元购车款。",
    url2: "/dingding-web/renteqsale/img/AX7 2.0L_btn.png",
    url3: "/dingding-web/renteqsale/img/AX7 1.4T_btn.png",
    carId1: "1",
    carId2: "2"
  }
  //本田首页数据
  var data2 = {
    url1: "/dingding-web/renteqsale/img/yage_banner.jpg",
    p1: "叮叮约车推出“共享用车计划”，旨在鼓励车主绿色出行，让更多的人加入到分享经济的大潮中来，为解决城市拥堵，减少尾气排放做出贡献。",
    p2: "叮叮约车的用户只需缴纳少量保障金和租金就可领取由广汽本田提供的雅阁新车一辆，提前获得车辆使用权。"+
        "用户获得车辆使用权后要积极参与共享计划，在上下班途中发布顺风车行程，接乘顺路乘客。",
    p3: "车型方面目前叮叮约车为用户提供雅阁2.0精英版和2.0舒适版。"+
        "待车辆租期年限到期且足额交纳租金后，将车辆所有权过户给客户。",
    url2: "/dingding-web/renteqsale/img/jingying_btn.png",
    url3: "/dingding-web/renteqsale/img/shushi_btn.png",
    carId1: "3",
    carId2: "4"
  }

  var tpl = document.getElementById("tpl").innerHTML;

  //获取参数id 5-->东风，6-->雅阁
	var dif_id = getQueryStr("bizId");
  //var dif_id = "6";//上线改

  switch (parseInt(dif_id)){
    case 5:
      var html = juicer(tpl,data1);
      break;
    case 6:
      var html = juicer(tpl,data2);
      break;
  }

  //var html = juicer(tpl,data1);
  $("body").html(html);

  var data = {};
  var userId;
  /*页面加载获取userId*/
//    if (isIOS()) {
//		var userId = getQueryStr("userId");
//		}else{
//			var userId = JavascriptInterface.getUserId();
//		}
  
  	userId = getQueryStr("userId");
    
  	
    var cityNo = getQueryStr("cityNo");
    var identifyId = getQueryStr("identifyId");
    if(identifyId != "999"){
        $(".close-icon").remove();
        if (isIOS()) {
        	userId = getQueryStr("userId");
		}else{
			userId = JavascriptInterface.getUserId();
		}
      }
    data.userId = userId;
      $(".close-icon").on("click",function(){
        window.location.href = "/dingding-web/shareplan/weixin.html?cityNo="+cityNo+"&userId="+userId;
      })
    
  /*用户点击车型获取carId*/
  $(".get-carId img").on("click",function(){
    data.carId = $(this).attr("data-carId");
    //东风1
    window.location.href = "/dingding-web/renteqsale/base_detail.html?userId="+data.userId+"&carId="+data.carId+"&identifyId="+identifyId+"&cityNo="+cityNo;
  });

  setInterval(function(){
    $(".get-carId i").animate({opacity:"0"}).animate({opacity:"1"});
  },1000);

});